//
// Created by bjliuyong on 2021/6/15.
//

#ifndef GC_MARK_COMPACT_H
#define GC_MARK_COMPACT_H

#include "./interface/garbage_collect.h"
#include "../memory/memory_chunk.h"

class MarkCompact : public GarbageCollect {
private:
    MemoryChunk *m_mem_chunk;
public:
    MarkCompact(MemoryChunk *memoryChunk);

    ~ MarkCompact();

public:

    void run() override;

private:

    void mark();

    void clean();

    void memory_compact();

    void data_compact();
};

#endif //GC_MARK_COMPACT_H
